home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 5.3 KB | 108 lines | [TEXT/GEOL] |
- Item 4655179 7-Sept-90 04:44PDT
-
- From: D6187 ObjectSoft, Barry Wilson,PRT
-
- To: DEREK White, Derek
- MACAPP.TECH$ MacApp Technical
-
- Sub: OP++ Revisited
-
- Derek (& Kurt, Eric, Howard & MacApp Tech),
-
- Thanks for your incredibly rapid comments to my posting. I have to admit that
- most of what I wrote was first written very late at night and I didn't mean to
- irk anyone. I agree with you, Eric, about the right tool for the right job, but
- then I still fail to understand why C++ garners widespread acceptance when
- Simula has the same features. I maintain that C programmers are just as
- religious about C as Pascal programmers are about their faith and this explains
- a lot more about C++ versus Object Pascal than simply looking at a list of
- features.
-
- As for the list of enhancements I proposed, upon rereading I did notice some
- things that must have escaped me at the late hour. So I'd like to add some
- comments.
-
- Private Methods & Fields
- My main reason for proposing that declarations of methods be allowed inside of
- implementations is that it really changes nothing about the language. In fact,
- if I hadn't been told otherwise, I would have tried to declare a method in an
- implementation long ago. Adding more syntax for fields and methods is certainly
- possible, and would give Object Pascal all of the options of C++ and more if
- desired. But if new syntax is to be added, I hope that some careful thought
- will go into selecting the form it takes. The syntax of Pascal should not by
- tinkered with lightly. I'm inclined to say that no committee should touch the
- language, and instead we should give Herr Professor Wirth a list of what we
- want and then sit back and wait.
-
- Class Declarations
- I have to agree that allowing locally scoped class declarations is dangerous.
- If I declare a new type 'MyRecordType' in a local routine there is no problem
- with assigning a variable 'm: MyRecordType' to a global 'g', becuase the global
- couldn't have been declared. Having this same kind of checking for objects is
- problematic because assigning a MyListType variable to a TList variable is
- exactly the kind of thing that makes objects powerful. The compiler would have
- to include the scopes of the types in its criteria for assignment compatibility
- of objects. I think that as a feature it is probably not worth the effort nor
- the complexity it would add to the compiler.
-
- Reusability
- The scheme I described doesn't really replace mixin classes or protocols
- because the global routines can't use method calls in any polymorphic way
- amongst the classes using them. Someone clever enough to use the class
- information available a runtime might be able to work around this though.
-
- Scoping and Reusability
- I agree about the locally declared method not being polymorphic, but it could
- be an override. I suppose that one could avoid the method entirely and pass the
- object to a regular procedure that did the same thing. Since the local
- procedure can access the same fields and make method calls to the object it
- doesn't sound like local methods are really needed. However, if later versions
- of Object Pascal add privacy features, then being able to make a local method
- might make the difference.
-
- The real problem I wanted to address with local classes and methods is the
- plethora of global junk that collects in OO systems in general. Code
- reusability is a great and noble goal, but sometimes you write code that you
- KNOW shouldn't be reused by anyone. Hopefully USES and classes in the
- implementation will go a long way towards fixing this. I've worked in totally
- object oriented environments where somebody's one-shot quick and dirty class is
- visible in the browser for everyone to see (and use). Soon you have more than a
- dozen of them, and they can't be removed or changed because they do get reused.
-
- Operator Overloading
- I meant Method Overloading. I think that I did have something to say about
- operator overloading when I wrote the title late that night. But in the light
- of day I sure don't remember it.
-
- Genericity
- Yes, what I proposed isn't parameterized types. But it solves the most common
- problem I have with MacApp at the moment. I hate changing MacApp because then I
- dread the next release. But then I find that I have to change MacApp to get the
- results I want. For instance, I wrote my own floating window code a while back,
- which is not surprisingly almost exactly the same as what was just released on
- the ETO CD. Now, if I want to keep in tune with Apple I have to change MacApp
- yet another time. A feature that let me easily slip a class in between two
- classes in the hierarchy would be a godsend, because I could just as easily
- take it back out again.
-
- INHERITED versus TView(myWindow).IRes
- My problem is that I need to be able to do TView(SELF).IRes, which didn't work
- last time I tried it. I'll try first assigning SELF to a myWindow variable and
- see what happens. Maybe someone out there knows another way? I remember someone
- once discussing this same problem.
-
- Taking back a feature
- I didn't really mean removing it, just changing its scope. Another nice feature
- of Eiffel that I wouldn't mind Object Pascal borrowing would be renaming
- features.
-
- Well, another long link that started life as a short one.
-
- Barry Wilson
- ObjectSoft, Inc.
-
-
-
-
-
-